SwappableImage

Wraps an image implementation up so that the exact implementation doesn't matter. As long as the color type is known it can be passed around freely. It does not allocate to perform its functions and can be safely used on the stack.

Constructors

this
this()
Undocumented in source.
this
this(size_t width, size_t height, IAllocator alloc)
Undocumented in source.
this
this(T from, IAllocator allocator)

Constructs a swappable image using a specific image storage type as its value.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

getPixel
Color getPixel(size_t x, size_t y)

Get a pixel given the position.

getPixelAtOffset
Color getPixelAtOffset(size_t offset)

Get a pixel given the position.

opIndex
Color opIndex(size_t x, size_t y)

Get a pixel given the position.

opIndex
Color opIndex(size_t offset)

Get a pixel given the position.

opIndexAssign
void opIndexAssign(Color value, size_t x, size_t y)

Sets a pixel given the position.

opIndexAssign
void opIndexAssign(Color value, size_t offset)

Set a pixel given the position.

resize
bool resize(size_t newWidth, size_t newHeight)

Resizes the data store.

setPixel
void setPixel(size_t x, size_t y, Color value)

Sets a pixel given the position.

setPixelAtOffset
void setPixelAtOffset(size_t offset, Color value)

Set a pixel given the position.

Properties

count
size_t count [@property getter]

Gets the number of pixels the image contains

height
size_t height [@property getter]

Gets the height of the image

original
void* original [@property getter]

A pointer to the original image storage type. Use at your own risk.

width
size_t width [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Meta